(require 'asdf)

(let ((config-file (merge-pathnames #p".sbclrc" (user-homedir-pathname)))
      (asdf-dir (merge-pathnames #p"*/")))
  (format t "~%Customizing your ~~/.sbclrc .~%")
  (format t "This will append to the end of any current configuration.~%")
  (with-open-file (stream config-file :direction :output
                          :if-exists :append :if-does-not-exist :create)
    (labels ((code (&rest forms) (format stream "~{~s~%~}" forms))
             (comment (&rest lines) (format stream "~{~a~%~}" lines)))
      (terpri stream)
      (comment ";;;; Section added by the Blackthorn Starter Pack.")
      (code `(require 'asdf)
            `(dolist (dir (directory ,asdf-dir))
               (pushnew dir asdf:*central-registry* :test #'equal)))
      (comment ";;;; End Blackthorn Starter Pack section."))))

(quit)
